1. Field of the Invention
The present invention relates to a method of generating data for three-dimensional graphics in which three-dimensional graphics display can be carried out with a comparatively simple circuit structure.
2. Description of the Background Art
In a conventional three-dimensional graphic accelerator, a vertex data value (X, Y, Z, R, G, B, xcex1, U, V) of each polygon on a screen is to be calculated by screen projection coordinate transformation (geometry operation) prior to drawing on a screen. This is intended for implementing interactive properties (for example, an operator can freely move a view point and a character in a virtual three-dimensional space). (X, Y, Z) denotes three-dimensional coordinates, xcex1 denotes an xcex1 value (data indicative of a transmittance), (R, G, B) denotes color data, and (U, V) denotes texture coordinate data. Texture data defining a pattern corresponding to each vertex data are further added. The texture coordinate data are informations for cutting out (arranging) the pattern defined by the texture data.
The prior art related to three-dimensional graphics has been disclosed in Japanese Patent Application Laid-Open No. 8-212377 (1996), Japanese Patent Application Laid-Open No. 7-262387 (1995), Japanese Patent Application Laid-Open No. 8-7123 (1996) and the like, for example. The prior document teaching the modeling of the three-dimensional graphics includes xe2x80x9cApplication Graphics, ASCII publishing office, pp. 47-57) and the like.
FIG. 23 is a block diagram showing a structure of a three-dimensional graphics system in a conventional portable game machine and some amusement equipment.
As shown in FIG. 23, a CPU 1, a ROM 2, a RAM 3, a sound source IC 4, an image memory 6, a display unit 7 and an input device 9 are directly connected to a graphic accelerator 5P, and a speaker 8 is connected to the sound source IC 4.
The CPU 1 executes a program stored in the ROM 2 based on an input information obtained from the input device 9, thereby generating three-dimensional object data in a frame unit and sequentially transferring them to the graphic accelerator 5P. At this time, the RAM 3 is used as a work area by the CPU 1. Moreover, the CPU 1 transfers a playing information to the sound source IC 4 if necessary, and the sound source IC 4 converts the playing information into voice data and outputs the voice data to the speaker 8.
The graphic accelerator 5P performs a three-dimensional graphics operation for three-dimensional object data transferred from the CPU 1 and writes the resultant screen drawing data to the image memory 6. The screen drawing data of the image memory 6 are transferred to the display unit 7 in a specified timing.
The graphic accelerator 5P includes a geometry processing section 5P1, a light source processing section 5P2 and a rendering section 5P3. The three-dimensional object data are subjected to a geometry operation by the geometry processing section 5P1, a processing related to a light source by the light source processing section 5P2 and a rendering processing by the rendering section 5P3. The screen drawing data thus obtained are written to the image memory 6.
FIG. 24 shows an operation flow of a conventional method of generating a three-dimensional graphics control program.
With reference to FIG. 24, at a step S11, an in-frame control information 27 defining the contents of control in one frame is manually created based on object data 10 in which a shape of an object is represented by, body coordinates and scene data 11 in which a positional relationship of the object in a virtual three-dimensional space is represented by world coordinates.
At a step S12, a three-dimensional graphics control program 28 for a sound, an event obtained from the input device 9 and the like is manually created based on the in-frame control information 27.
However, in the case in which the system shown in FIG. 23 is to be implemented by a portable game machine or the like having limitations on a hardware structure, it is hard to store, in the ROM 2, an enormous three-dimensional graphics information which has not been subjected to the geometry operation and to provide the geometry processing section 5P1 having a comparatively great circuit scale in the graphic accelerator 5P.
Main three-dimensional graphics informations to be stored in the ROM 2 are as follows:
{circle around (1)} a body coordinate value defining the movement of an object present in a space;
{circle around (2)} various polygon informations in body coordinates (vertex coordinate value/blend color information/texture information);
{circle around (3)} a world coordinate value defining a relative positional relationship of an object;
{circle around (4)} a positional relationship between a view point and world coordinates; and
{circle around (5)} a positional relationship between a light source and world coordinates.
In an apparatus in which a hardware structure is restricted, interactive properties are restricted based on a screen size and matters for restriction on amusing properties, or are abolished. Moreover, there is not a method of generating data for three-dimensional computer graphics which is suitable for a three-dimensional graphics system having a comparatively low throughput. Therefore, there has been a problem in that it is hard to implement three-dimensional graphics display at a practical level by the three-dimensional graphics system having a comparatively low throughput.
A first aspect of the present invention is directed to a method of generating data for three-dimensional graphics to be used by a predetermined three-dimensional graphics system, comprising the steps of (a) sequentially reading three-dimensional original data including object data defining a three-dimensional object in a predetermined unit, (b) executing an operation processing including a geometric operation and a light source computation for the three-dimensional original data, thereby obtaining operated three-dimensional data, and (c) obtaining the data for three-dimensional graphics based on the operated three-dimensional data, the step (c) executing an optimization processing such that a data amount of the data for three-dimensional graphics is more reduced than that of the operated three-dimensional data based on a hardware constraint including a constraint related to a throughput of the predetermined three-dimensional graphics system.
A second aspect of the present invention is directed to the method of generating data for three-dimensional graphics according to the first aspect of the present invention, wherein the step (c) includes a step of deciding a major edge to be a reference side for drawing in sides of a polygon constituting the three-dimensional object based on the operated three-dimensional data by an existing deciding method and causing the data for three-dimensional graphics to have an information defining the major edge.
A third aspect of the present invention is directed to the method of generating data for three-dimensional graphics according to the first or second aspect of the present invention, wherein the data for three-dimensional graphics have color data, the predetermined three-dimensional graphics system has a color display function based on a color index information, and the color index information has a smaller amount than the color data, the method further comprising a step of (d) replacing the color data in the data for three-dimensional graphics with the index color data.
A fourth aspect of the present invention is directed to the method of generating data for three-dimensional graphics according to any of the first to third aspects of the present invention, wherein the optimization processing at the step (c) includes a processing of generating the data for three-dimensional graphics such that repeated vertex data between a plurality of polygons constituting the object are omitted.
A fifth aspect of the present invention is directed to the method of generating data for three-dimensional graphics according to any of the first to fourth aspects of the present invention, wherein the predetermined unit includes one frame unit, and the hardware constraint includes at least one of a condition related to a storage capacity of the data for three-dimensional graphics of the predetermined three-dimensional graphics system and a condition related to a transferable data amount in one frame of the predetermined three-dimensional graphics system.
A sixth aspect of the present invention is directed to the method of generating data for three-dimensional graphics according to any of the first to fourth aspects of the present invention, wherein the three-dimensional graphics system performs three-dimensional graphics display with the same contents as those in previous frames upon receipt of a recycle indicating information, the operation processing includes an operation based on an operation condition and the predetermined unit includes a plurality of frame units, the step (a) outputs a temporary recycle indicating information if it is decided that the data for three-dimensional graphics are not changed between various frames, the step (b) outputs the recycle indicating information as the operated three-dimensional data without executing the operation processing when the temporary recycle indicating information is received and the operation condition is not changed between various frames, and the step (c) outputs the recycle indicating information as the data for three-dimensional graphics when receiving the recycle indicating information as the operated three-dimensional data.
A seventh aspect of the present invention is directed to a computer readable recording medium in which a program for causing a computer to execute the method of generating data for three-dimensional graphics according to any of the first to sixth aspects of the present invention is recorded.
According to the first aspect of the present invention, the operation processing including the geometric operation and the light source computation is executed at the step (b). It is possible to perform three-dimensional graphics display by using a three-dimensional graphics system which does not have the function of executing these processings (the geometric operation and the light source computation).
At the step (c), furthermore, the optimization processing is executed such that the data amount of the data for three-dimensional graphics is reduced based on the hardware constraint including a constraint related to the throughput of the predetermined three-dimensional graphics system. Therefore, it is also possible to reduce a storage capacity of the data for three-dimensional graphics in the predetermined three-dimensional graphics system.
As a result, also in the case in which the predetermined three-dimensional graphic data have a comparatively low throughput, the three-dimensional graphics display can be carried out at a practical level.
According to the second aspect of the present invention, the information defining a major edge is included in the data for three-dimensional graphics. Therefore, the predetermined three-dimensional graphics system does not need to have the function of executing the major edge decision processing. Correspondingly, the throughput of the predetermined three-dimensional graphics system can be reduced.
According to the third aspect of the present invention, the color data in the data for three-dimensional graphics are replaced with the index color data having a smaller information amount at the step (d). Therefore, the storage capacity of the data for three-dimensional graphics in the predetermined three-dimensional graphics system can be reduced still more.
According to the fourth aspect of the present invention, the optimization processing at the step (c) includes the processing of generating data for three-dimensional graphics such that the vertex data repeated between a plurality of polygons constituting an object are omitted. Therefore, the storage capacity of the data for three-dimensional graphics in the predetermined three-dimensional graphics system can be reduced still more.
According to the fifth aspect of the present invention, the hardware constraint includes at least one of the condition related to the storage capacity of the data for three-dimensional graphics of the predetermined three-dimensional graphics system and the condition related to the transferable data amount in one frame. Therefore, it is possible to generate data for three-dimensional graphics to be adapted to the storage capacity of the predetermined three-dimensional graphics system or the transferable data amount.
According to the sixth aspect of the present invention, if it is recognized that the data for three-dimensional graphics and the operation condition are not changed between various frames at the steps (a) and (b), the recycle indicating information is output as the data for three-dimensional graphics at the step (c). Correspondingly, the storage capacity of the data for three-dimensional graphics in the predetermined three-dimensional graphics system can be reduced still more.
According to the seventh aspect of the present invention, the computer is caused to execute the method of generating data for three-dimensional graphics which is recorded in the recording medium. Consequently, also in the case in which a three-dimensional graphics system having a comparatively low throughput is used, it is possible to automatically generate data for three-dimensional graphics capable of performing three-dimensional graphics display at a practical level.
In order to solve the above-mentioned problem, it is an object of the present invention to obtain a method of generating data for three-dimensional graphics which can carry out three-dimensional graphics display at a practical level also in the case in which a three-dimensional graphics system having a comparatively low throughput is used.
These and other objects, features, aspects and advantages of the present invention will become more apparent from the following detailed description of the present invention when taken in conjunction with the accompanying drawings.